Skip to content

protobuf-python: restore builds and fuzz DescriptorPool inputs - #15901

Open
slegarraga wants to merge 4 commits into
google:masterfrom
slegarraga:protobuf-python-descriptor-pool-fuzzer
Open

protobuf-python: restore builds and fuzz DescriptorPool inputs#15901
slegarraga wants to merge 4 commits into
google:masterfrom
slegarraga:protobuf-python-descriptor-pool-fuzzer

Conversation

@slegarraga

@slegarraga slegarraga commented Jul 23, 2026

Copy link
Copy Markdown

Restores the current protobuf-python project build and adds a dedicated Atheris target for serialized descriptor inputs.

Current Protobuf uses Bzlmod and no longer supports the stale --noenable_bzlmod override. This removes that override from the Docker preflight and fuzzer build, and uses a shallow source clone.

The new target creates an isolated DescriptorPool for each input and calls AddSerializedFile. Expected descriptor validation errors are discarded while native crashes and sanitizer findings remain visible. It follows the existing fuzz_*.py discovery convention.

The Bazel wheel build now also propagates the OSS-Fuzz fuzzer-no-link instrumentation into the native extension. This preserves ASan while allowing libFuzzer to receive coverage feedback from the upb parser rather than only from the Python wrapper.

Local Linux x86_64 validation with the OSS-Fuzz helpers:

  • project image built successfully against current Protobuf HEAD
  • ASan fuzzer build completed all 2,079 Bazel actions
  • the CPython abi3 wheel was produced and installed
  • both fuzz_protobuf and fuzz_descriptor_pool were packaged successfully
  • a 31-second fuzz_descriptor_pool smoke run completed 519,722 executions with no sanitizer finding
  • native coverage grew from cov: 421 / ft: 422 to cov: 1437 / ft: 4216, adding 1,695 corpus units

@github-actions

Copy link
Copy Markdown

slegarraga is a new contributor to projects/protobuf-python. The PR must be approved by known contributors before it can be merged. The past contributors are: hunsche, zhangskz, maflcko, mkruskal-google

@slegarraga

Copy link
Copy Markdown
Author

/gcbrun trial_build.py protobuf-python --sanitizer address --fuzzing-engine libfuzzer

@slegarraga
slegarraga force-pushed the protobuf-python-descriptor-pool-fuzzer branch from d5a0df8 to 990b990 Compare July 23, 2026 18:08
@slegarraga slegarraga changed the title protobuf-python: fuzz DescriptorPool.AddSerializedFile protobuf-python: restore builds and fuzz DescriptorPool inputs Jul 23, 2026
@slegarraga

Copy link
Copy Markdown
Author

@mkruskal-google, could you please review the protobuf-python integration changes when you have a chance? The current project had stale --noenable_bzlmod overrides; I verified build_image and the x86_64 ASan build_fuzzers flow locally, including both fuzz targets. Thanks.

@slegarraga

Copy link
Copy Markdown
Author

/gcbrun trial_build.py protobuf-python --sanitizer address --fuzzing-engine libfuzzer

@DavidKorczynski

Copy link
Copy Markdown
Collaborator

@slegarraga please don't try to run the gcbrun commands. We will make sure the CI runs.

@slegarraga

Copy link
Copy Markdown
Author

Understood, thank you. I will not run any further gcbrun commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants